Skip to content

Conversation

typotter
Copy link
Collaborator

@typotter typotter commented Feb 25, 2025

Eppo Internal
🎟️ Fixes FF-3454
πŸ“œ DD

  • updates to sdk-common-jdk:3.8.0
  • getConfiguration
  • startPolling and stopPolling as instance methods on EppoClient
  • bump to v5.0.0

Breaking Change
The static method EppoClient.stopPolling() has been removed in favour of using the instance method stopPolling().

// This method has been removed
EppoClient.stopPolling();

// use this instead
getInstance().stopPolling();

// If you are unsure whether the EppoClient has been initialized when you wish to call stopPolling, try-catch:
try {
  EppoClient.getInstance().stopPolling();
} catch (IllegalStateException ex) {
  // pass: Indicates that the singleton Eppo Client has not yet been initialized.
}

@@ -62,13 +60,6 @@ private EppoClient(
banditAssignmentCache);
}

/** Stops the client from polling Eppo for updated flag and bandit configurations */
public static void stopPolling() {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

stopPolling is now a method on the EppoClient instance, so it can't be overridden by a static method.
I do not expect this will be a high friction change for developers, if a change is required at all (fewer devs will use stopPolling than will use startPolling).

build.gradle Outdated
@@ -11,7 +11,7 @@ java {
}

group = 'cloud.eppo'
version = '4.0.1-SNAPSHOT'
version = '5.0.0'
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

major bump as the static method stopPolling has been removed.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

πŸ‘ Makes sense!

Copy link
Collaborator

@aarsilv aarsilv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

Agree stopPolling() likely is only used in test environments and whatnot

build.gradle Outdated
@@ -11,7 +11,7 @@ java {
}

group = 'cloud.eppo'
version = '4.0.1-SNAPSHOT'
version = '5.0.0'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

πŸ‘ Makes sense!

@@ -30,7 +30,7 @@ repositories {
}

dependencies {
api 'cloud.eppo:sdk-common-jvm:3.6.0'
api 'cloud.eppo:sdk-common-jvm:3.8.0'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

πŸ“ˆ

@@ -257,6 +263,15 @@ public void testClientMakesDefaultAssignmentsAfterFailingToInitialize() {
}
}

@Test
public void testGetConfiguration() {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

πŸ’ͺ

Configuration configuration = eppoClient.getConfiguration();
assertNotNull(configuration);
assertNotNull(configuration.getFlag("numeric_flag"));
assertEquals(VariationType.NUMERIC, configuration.getFlagType("numeric_flag"));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

πŸ”₯

@typotter typotter merged commit af4eea5 into main Feb 25, 2025
4 checks passed
@typotter typotter deleted the tp/common-latest branch February 25, 2025 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants